package com.middlegroup.common.mybatisplus;
 
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public abstract class BaseEntity<T extends Model> extends Model<T> implements Serializable {
 
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    protected Long id ;
    /*
     * 创建时间
     */
    @TableField(value = "add_time",fill = FieldFill.INSERT)
    private Long addTime;
    /*
     * 最后修改时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Long updateTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
 
}